Bonzomatic (Network Fork)
This fork was motivated by the COVID-19 situation to offer a simple way to have Livecoding on internet. The Network Fork and the Original Bonzomatic used to have the same code base, modulo the network module. Nowdays, the code between the 2 version differs a little bit, but the overall concept are the same and the code are compatible. With the success of this version and the #shader_royale format, an helper tool has been created Bonzomatic Launcher to help as a host of multiple #grabber instance to VJ and manage the instances to display. Developed bu NuSan
Run Option
It's possible to skip the launcher windwos and connect directl from command line :
code:bonzomatic_start.bat
.\Bonzomatic_W64_GLFW.exe skipdialog networkMode=sender serverURL=ws://<ip>/<roomtest>/<YOURNAME>
Network protocol
To communicate between the instances, Bonzomatic Network use the Websocket protocol. The instances can't communicate to each other directly and need to have a Bonzomatic Server that will dispatch the messages. This server can't be any Websocket based server that should respect this interface :
- A websocket service should be accessible at an endpoint /{room}/{user}
- The websocket service react as a broadcast endpoint, if one instance send a message, all other instances connected to this endpoint should recevied this message.
Payload for each message is a json formated file terminated with a null character ( \0 )
code:example_payload.json
{
"Data": {
"Anchor": 0,
"Caret": 0,
"Code": "#version 410 core\n\nuniform float fGlobalTime; // in seconds\nuniform vec2 v2Resolution; // viewport resolution (in pixels)\nuniform float fFrameTime; // duration of the last frame, in seconds\n\nuniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq\nuniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients\nuniform sampler1D texFFTIntegrated; // this is continually increasing\nuniform sampler2D texPreviousFrame; // screenshot of the previous frame\nuniform sampler2D texChecker;\nuniform sampler2D texNoise;\nuniform sampler2D texRevision;\nuniform sampler2D texTex1;\nuniform sampler2D texTex2;\nuniform sampler2D texTex3;\nuniform sampler2D texTex4;\n\nlayout(location = 0) out vec4 out_color; // out_color must be written in order to see anything\n\nvec4 plas( vec2 v, float time )\n{\n\tfloat c = 0.5 + sin( v.x * 10.0 ) + cos( sin( time + v.y ) * 20.0 );\n\treturn vec4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 );\n}\nvoid main(void)\n{\n\tvec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y);\n\tuv -= 0.5;\n\tuv /= vec2(v2Resolution.y / v2Resolution.x, 1);\n\n\tvec2 m;\n\tm.x = atan(uv.x / uv.y) / 3.14;\n\tm.y = 1 / length(uv) * .2;\n\tfloat d = m.y;\n\n\tfloat f = texture( texFFT, d ).r * 100;\n\tm.x += sin( fGlobalTime ) * 0.1;\n\tm.y += fGlobalTime * 0.25;\n\n\tvec4 t = plas( m * 3.14, fGlobalTime ) / d;\n\tt = clamp( t, 0.0, 1.0 );\n\tout_color = f + t;\n}",
"Compile": true,
"FirstVisibleLine": 0,
"NickName": "Coder_03",
"RoomName": "roomtest2",
"ShaderTime": 0.3130443096160889
}
}
MIDI Controller
Midi controller can be used to interact with bonzomatic shader.
You need to provide a mapping between the CC Number and the variable it needs to be injected into the shader.